import { request } from './request'
//获取已完成和未完成的工单列表
export const orderList = (comID: number, useid: number, type: string, isFinal: string) => request.post('/request/GetRequestInfos', { comID, useid, type, isFinal })
//获取管家已完成和未完成的工单列表
export const orderListGJ = (comID: number, useid: number, type: string, isFinal: string) => request.post('/request/GetRequestInfosForGuanjia', { comID, useid, type, isFinal })
//工单详情
export const orderDetail = (comID: number, requestid: number) => request.post('/request/GetRequestDetail', { comID, requestid })
//工单维修记录
export const maintenanceList = (houseID: number, comID: number) => request.post('/request/GetHistoryByHouseID', { houseID, comID })
//完成工单详情
export const finishedOrder = (comID: number, requestid: number) => request.post('/request/GetFinishRequest', { comID, requestid })
//工单处理
export const orderProcessor = (comID: number, data: any) => request.post('/request/RequestFinish', { comID, ...data })
//退单
export const chargeBack = (comID: number, repairID: number, userID: number, param: number, revokeReason: string) => request.post('/request/reBackRepair', { comID, repairID, userID, param, revokeReason })
//获取抢单列表
export const alarmList = (comID: number) => request.post('/order/CanSeizeOrders', { comID })
//抢单
export const RepairOrder = (comID: number, userid: number, repairOrderId: number) => request.post('/order/RushRepairOrder', { comID, userid, repairOrderId })
//待处理工单
export const PendingOrders = (comID: number, userid: number) => request.post('/order/PendingOrdersOrders', { comID, userid })
//是否打卡
export const isClockin = (comID: number, requestNumFk: number, Time: string) => request.post('/poll/MaintenanceSchedule', { comID, requestNumFk, Time })
//消息列表
export const infoList = (comID: number) => request.post('/order/GetPushs', { comID })
//发送消息
export const setInfo = (comID: number, pusherid: number, pusher: string, pushContent: string) => request.post('/order/PublishMsg', { comID, pusherid, pusher, pushContent })
//管家派单
export const stewardOrder = (comID: number, userID: number, repairPersonID: number, requestid: number, repairPersonName: string) => request.post('/request/isSendForGuanjia', { comID, userID, repairPersonID, requestid, repairPersonName })
//派单查询维修工
export const searchMaintainer = (comID: number, userID: number) => request.post('/request/getRepairPerson', { comID, userID })
//当日进行中的工单
export const loadingOrder = (comID: number, userID: number) => request.post('/request/AllUnfinished', { comID, userID })
//除去当日进行中的工单
export const todayOrder = (comID: number, userID: number) => request.post('/request/AllUnfinishedForOthers', { comID, userID })
//管家获取已完成工单
export const stewarAllOrder = (comID: number, useid: number, type: string, isFinal: string) => request.post('/request/GetRequestInfosForGuanjia', { comID, useid, type, isFinal })
//工单数量
export const orderNum = (comID: number, userID: number,) => request.post('/request/AllRepairTotal', { comID, userID })
//非管家数量
export const orderNums = (comID: number, userID: number,) => request.post('/request/AllRepairTotals', { comID, userID })
//管家停止接单
export const stopOrder = (comID: number, userID: number, param: number) => request.post('/request/receiveRepairOnOrOff', { comID, userID, param })
//获取维修工当日未完成工单数量
export const dayOrderNumber = (comID: number, userID: number) => request.post('/request/NowDayCount', { comID, userID })
//获取维修工全部未完成工单数量
export const allOrderNumber = (comID: number, userID: number) => request.post('/request/AllCount', { comID, userID })
//获取接单状态
export const orderStatus = (comID: number, userID: number) => request.post('/request/GetReceiveRepair', { comID, userID })
//小区工单统计
export const villageOrderStatistics = (comID: number, startTime: string, endTime: string,userID:number) => request.post('/request/repairCountForVillage', { comID, startTime, endTime,userID })
//楼栋工单统计
export const buildingOrderStatistics = (comID: number, villageID: number, startTime: string, endTime: string,userID:number) => request.post('/request/repairCountForBuilding', { comID, villageID, startTime, endTime,userID })
/** 
 * 祝融工单接口
*/
// 工单数量
export const ZRorderNums = (comID: number, userid: number) => request.post('/request/RepairTotal', { comID, userid })
// 可抢单列表
export const ZRCanSeizeOrders = (comID: number) => request.post('/order/CanSeizeOrders', { comID })
// 所有待处理工单(0:今日 1:历史 2:催单 3:转派)
export const ZRPending = (comID: number, selectType: number, userid: number) => request.post('/request/allUnfinishedOrder', { comID, selectType, userid })
// 所有已完成工单(0:今日工单 1:历史工单)
export const ZRCompleted = (comID: number, selectType: number, userid: number) => request.post('/request/allFinishedOrder', { comID, selectType, userid })
// 抢单
export const ZRGrabbing = (userid: number, repairOrderId: number, comID: number, userName: string) => request.post('/order/RushRepairOrder', { userid, repairOrderId, comID, userName })
// 工单转派
export const orderTransfer = (comID: number, userID: number, repairPresonId: number, repairPersonName: string, requestID: number, repairPresonFK: number, revokeReason: string) => request.post('/request/changeRepairName', {
  comID: comID,
  userID: userID,
  repairPresonId: repairPresonId,
  repairPersonName: repairPersonName,
  requestID: requestID,
  repairPresonFK: repairPresonFK,
  revokeReason: revokeReason
})
// 维修工已读未读
export const updateIsRead = (comID: number,requestID: number) =>request.post('/request/updateIsRead',{comID,requestID})